package com.lyouu.dataminer.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.lyouu.dataminer.db.DbConstants;
import com.lyouu.dataminer.factory.MysqlDbFactory;
import com.lyouu.dataminer.util.Constants;

public class MdMysubjectDao {
	public void insert(int uid, int sid, int modelid) throws SQLException {
		Connection conn =  MysqlDbFactory.getConnection(DbConstants.DB_LYOUU);
		String sql = "INSERT INTO md_mysubject" + "(uid,sid,modelid,lasttime)"
				+ " VALUES (?,?,?,?)";
		PreparedStatement stmt = conn.prepareStatement(sql);
		stmt.setInt(1, uid);
		stmt.setInt(2, sid);
		stmt.setInt(3, modelid);
		stmt.setInt(4, (int) (System.currentTimeMillis() / 1000));
		stmt.executeUpdate();
	}
}
